# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=ubridge
pkgver=0.9.19
pkgrel=0
pkgdesc="Bridge for UDP tunnels, Ethernet, TAP and VMnet interfaces."
url="https://github.com/GNS3/ubridge"
arch="all"
license="GPL-3.0-or-later"
makedepends="libpcap-dev linux-headers"
install="$pkgname.post-install $pkgname.post-upgrade"
source="$pkgname-$pkgver.tar.gz::https://github.com/GNS3/ubridge/archive/v$pkgver.tar.gz
	musl-fixes.patch"

build() {
	make
}

check() {
	# This normally wouldn't be accepted but this is literally how upstream
	# CI does it
	./ubridge -v
}

package() {
	install -Dm755 ubridge -t "$pkgdir"/usr/bin
}

sha512sums="
b693a64569ba17fcb40f8a7894fcc205efba17fc3103150bb6f1d7a8a165505c88251e75f56d003f4c4337e97bffa57b5948156e42d01a2938b8d969a088ff32  ubridge-0.9.19.tar.gz
cc0fbb2963fe1faea05251e3536643e3eb5ad2c9a034b6c47e2d6cbcc1e8c89b0089c993a576450caa981b61ad01b20a684eb51c1793989dfc436b25951d86db  musl-fixes.patch
"
